package com.mfl.controller.user;

import com.mfl.common.Result;
import com.mfl.pojo.vo.CourseCategoryVO;
import com.mfl.service.CourseCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userCourseCategoryController")
@RequestMapping("/cky/user/courseCategory")
@Slf4j
public class CourseCategoryController {

    @Autowired
    private CourseCategoryService courseCategoryService;

    /**
     * 获取所有课程分类
     * @return
     */
    @GetMapping("/getCourseCategoryAll")
    public Result<List<CourseCategoryVO>> getCourseCategoryAll(){
        log.info("获取所有课程分类");
        List<CourseCategoryVO> voList = courseCategoryService.getAll();
        return Result.success("", voList);
    }
}
